#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__autho__ = "Tony.Don"
__lastupdatetime__ = "2017/09/20"

from abc import ABC,abstractmethod
from core.element import htmlelement
from core.event import eventmanager
from core.Enum import Enum
#abstractmethod class
'''
class\r\n
    analysis(ABC,eventmanager)\r\n
description\r\n
    tag分析抽象\r\n
'''
class analysis(ABC,eventmanager):
    
    __event__ = Enum(["S_TAG","E_TAG","DATA","COMMENT","ENTITYREF","CHARREF","DECL"])
    m_element = htmlelement()
    #event
    
    def __init__(self):
        '''
        Feature\r\n
            __init__(self)\r\n
        Description\r\n
            初始化\r\n
        '''
        pass
    @abstractmethod
    def s_tag(self,tag,attrs):
        '''
        Feature\r\n
            s_tag(self,tag,attrs)\r\n
        Description\r\n
            获取标签开始分析(<div>)\r\n
        Args\r\n
            tag\r\n
                type:string\r\n
                description:HTML标签\r\n
            attrs\r\n
                type:[]\r\n
                description:属性列表\r\n
        '''
        pass
    @abstractmethod
    def e_tag(self,tag):
        '''
        Feature\r\n
            e_tag(self,tag)\r\n
        Description\r\n
            获取标签结束分析(</div>)\r\n
        Args\r\n
            tag\r\n
                type:string\r\n
                description:HTML标签\r\n
        '''
        pass
    @abstractmethod
    def data(self,data):
        '''
        Feature\r\n
            data(self,data)\r\n
        Description\r\n
            获取标签分析(<script>...</script> 、<style>...</style>)\r\n
        Args\r\n
            tag\r\n
                type:string\r\n
                description:HTML标签\r\n
        '''
        pass
    @abstractmethod
    def comment(self,comment):
        '''
        Feature\r\n
            comment(self,comment)\r\n
        Description\r\n
            获取标签分析(<!--[if IE 9]>IE9-specific content<![endif]-->)\r\n
        Args\r\n
            tag\r\n
                type:string\r\n
                description:HTML标签\r\n
        '''
        pass
    @abstractmethod
    def entityref(self,entityref):
        '''
        Feature\r\n
            entityref(self,entityref)\r\n
        Description\r\n
            获取标签分析(&gt;)\r\n
        Args\r\n
            entityref\r\n
                type:string\r\n
        '''
        pass
    @abstractmethod
    def charref(self,charref):
        '''
        Feature\r\n
            charref(self,charref)\r\n
        Description\r\n
            获取标签分析( numeric character references of the form &#NNN; and &#xNNN;. )\r\n
        Args\r\n
            entityref\r\n
                type:string\r\n
        '''
        pass
    @abstractmethod   
    def decl(self,decl):
        '''
        Feature\r\n
            decl(self,decl)\r\n
        Description\r\n
            获取标签分析( <!DOCTYPE html> )\r\n
        Args\r\n
            entityref\r\n
                type:string\r\n
        '''
        pass
